Is the trigger works with spot?

Hi,all
I encountered a problem in using trigger, what I should claimed is the trigger works well, however, it has a spot, which can be described as follows.
I build a trigger to show a infoBox when users in my database open the specific module, named it "moduleA".the code is like this:

trigger("AA", module->formal->"moduleA", post, open, 10, "\infoBox\"Please do sth\"\")


Another module named "moduleB" exists in my project, there is a link module saved linksets between "moduleA" and "moduleB", after I opened "moduleA", installed the trigger, save the module, close it, the next time I open the "moduleA", the infoBox displayed correctly.
The problem is when I open the "moduleB", the infoBox also displayed, and I don't want it to show, why did it displayed when I open the "moduleB", is there any ways to prevent this, my aim is to display the infoBox only when user opened the "moduleA".
Looking for your help and best regards.
Sincerely, Aven.


Aven_HIT - Fri Dec 18 22:28:21 EST 2009

Re: Is the trigger works with spot?
Mathias Mamsch - Sun Dec 20 08:38:40 EST 2009

Hi Aven,

my guess is, that you have outlinks from module B to Module A, and there is some code in Module B that will open Module A invisibly, hence activating the module open trigger from module A.

So you have some possibilities:

a) remove the code from the standard view in B that is probably opening module A
b) Modify the trigger to only show the message box when module A is opened visibly:

Module m = module current Trigger
    if (!isVisible m) halt

 


c) Modify the trigger code to only show when the module is opened in "edit" mode (if it is appropriate for the message 'do something')

Regards, Mathias

 

Re: Is the trigger works with spot?
Aven_HIT - Mon Dec 21 11:12:33 EST 2009

Mathias Mamsch - Sun Dec 20 08:38:40 EST 2009

Hi Aven,

my guess is, that you have outlinks from module B to Module A, and there is some code in Module B that will open Module A invisibly, hence activating the module open trigger from module A.

So you have some possibilities:

a) remove the code from the standard view in B that is probably opening module A
b) Modify the trigger to only show the message box when module A is opened visibly:

Module m = module current Trigger
    if (!isVisible m) halt

 


c) Modify the trigger code to only show when the module is opened in "edit" mode (if it is appropriate for the message 'do something')

Regards, Mathias

 

Hey, Mathias

Thanks for your advice, I'll try it at once.

I'd like to take your "b)" advice, cause it's appropriate to my application, however, there is one thing I didn't get it clearly.

When module A and module B both opened, and I make them minimized, when module A maximized, the module repaint, would it cause the trigger works again.

Looking for your answers and best wishes.

Sincerely, Aven

Re: Is the trigger works with spot?
Mathias Mamsch - Tue Dec 22 06:58:04 EST 2009

Aven_HIT - Mon Dec 21 11:12:33 EST 2009
Hey, Mathias

Thanks for your advice, I'll try it at once.

I'd like to take your "b)" advice, cause it's appropriate to my application, however, there is one thing I didn't get it clearly.

When module A and module B both opened, and I make them minimized, when module A maximized, the module repaint, would it cause the trigger works again.

Looking for your answers and best wishes.

Sincerely, Aven

The "post open" event is fired, when you open the module for the first time and after that whenever you change the open mode (read, share, edit) (which is like reopening the module in another mode). Minimizing and Maximizing has nothing to do with this.

Regards, Mathias